﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class camera : MonoBehaviour
{
    public GameObject jueSe;    // 角色
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        // 摄像机跟随角色物体的位置，线性插值Lerp()；缓冲Vector3.Lerp(start.position, end.position, Time.time);
        transform.position = Vector3.Lerp( jueSe.transform.position, transform.position, .95f);
        transform.rotation = Quaternion.Lerp( jueSe.transform.rotation, transform.rotation, .95f);
        transform.position = new Vector3( transform.position.x, 0, transform.position.z);
        transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);
    }
}
